<%@page import="com.hqu.utils.DesUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String url = request.getRequestURL().toString();
	url = url.substring(0, url.indexOf('/', url.indexOf("//") + 2));
	String context = request.getContextPath();
	url += context;
	application.setAttribute("ctx", url);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>test page</title>
<%@ include file="/WEB-INF/include/commoncss.jsp"%>
</head>
<body>
<article class="page-container">
	<form action="${ctx}/api/login.do" method="post" class="form form-horizontal" id="form-member-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>数据：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="params" name="params">
			</div>
		</div>	
		<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>数据：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" value="" placeholder="" id="Wechat" name="Wechat">
		</div>
		</div>	
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">加密数据：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea name="endata" id = "endata" cols="" rows="" class="textarea"  placeholder="说点什么..." "></textarea>
				<p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;解密&nbsp;&nbsp;" onclick="decrypt()">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">解密数据：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea name="dedata" id ="dedata" cols="" rows="" class="textarea"  placeholder="说点什么..." "></textarea>
				<p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
			</div>
		</div>
		
	</form>
</article>
<%@ include file="/WEB-INF/include/commonjs.jsp"%>
<script type="text/javascript">
 
	function decrypt(){
		var endata = $("#endata").val();
		
		url = "${ctx}/app/destring";
        parameter = { params: endata };
        $.post(url, parameter, function (data) {   
        	document.getElementById('dedata').value=data;
        }) ;
	};
	
	
</script>
</body>
</html>